package org.libermundi.theorcs.main.tapestry.pages.admin;

import org.apache.tapestry5.annotations.OnEvent;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.libermundi.theorcs.core.services.SearchServices;
import org.libermundi.theorcs.main.tapestry.base.MainPrivatePage;
import org.libermundi.theorcs.security.SecurityConstants;
import org.springframework.security.access.annotation.Secured;

@Secured({SecurityConstants.ROLE_ROOT,SecurityConstants.ROLE_ADMIN})
public class Index extends MainPrivatePage {
	public static final String PAGE_ID="main.pages.admin.index";
	
	@Inject
	private SearchServices _searchServices;

	/* (non-Javadoc)
	 * @see org.libermundi.theorcs.core.tapestry.base.BasePage#getPageId()
	 */
	@Override
	public String getPageId() {
		return PAGE_ID;
	}
	
	@OnEvent(value="fullIndex")
	public void doFullindex() {
		_searchServices.doFullindex();
	}
}
